package common

const (
	StatusOK = 200000 // RFC 7231, 6.3.1

	StatusBadRequest      = 400000 // RFC 7231, 6.5.1
	StatusUnauthorized    = 401000 // RFC 7235, 3.1
	StatusPaymentRequired = 402000 // RFC 7231, 6.5.2
	StatusForbidden       = 403000 // RFC 7231, 6.5.3
	StatusNotFound        = 404000 // RFC 7231, 6.5.4
	StatusTokenError      = 400001 // RFC 7231, 6.6.1

	StatusInternalServerError = 500000 // RFC 7231, 6.6.1

)

var statusText = map[int]string{
	StatusOK:              "OK",
	StatusBadRequest:      "Bad Request",
	StatusUnauthorized:    "Unauthorized",
	StatusPaymentRequired: "Payment Required",
	StatusForbidden:       "Forbidden",
	StatusNotFound:        "Not Found",
	StatusTokenError:      "Token Error",

	StatusInternalServerError: "Internal Server Error",
}

func StatusText(code int) string {
	return statusText[code]
}
